package com.zhao.service.serviceImpl;

import com.zhao.dao.DepartmentDao;
import com.zhao.pojo.Department;
import com.zhao.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpSession;
import java.util.List;

@Service
@Transactional
public class DepartmentServiceImpl implements DepartmentService {

    @Autowired
    DepartmentDao departmentDao;

    @Override
    public String getAllByUniversityID(String universityID, HttpSession session) {

        List<Department> departmentList = departmentDao.findByUniversityID(universityID);
        session.setAttribute("departmentList",departmentList);

        return "success";
    }
}
